package cn.gok.datasource.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

/**
 * @author: chen fan
 * @since: 2022/11/16 17:31
 * @description: 自定义的数据库框架的数据源

    @EnableConfigurationProperties注解： 让@ConfigurationProperties注解生效
 */
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "gok.mysql.datasource")
public class GokMySQLDataSource {
    private String username;
    private String password;
    private String driver;
    private String url;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public String toString() {
        return "GokMySQLDataSource{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", driver='" + driver + '\'' +
                ", url='" + url + '\'' +
                '}';
    }
}
